package design.patterns.factorymode.factorysimple;

/**
 * @Desc:
 * @author: cww
 * @DateTime: 2020-06-07 18:56
 */

public class ArtTracer {
    public static Shape factory(String type) throws Exception {
        if(type.equalsIgnoreCase("circle")){
            return new CircleShape();
        } else if (type.equalsIgnoreCase("square")){
            return new SquareShape();
        } else if (type.equalsIgnoreCase("triangle")){
            return new TriangleShape();
        } else {
            throw new Exception(type);
        }
    }
}
